package com.derek.omshopping.ui.classify;

import android.util.Log;

import com.derek.omshopping.bean.classify.ClassifyRightTypeBean;

import java.util.List;

/**
 * Created by My on 2016/10/19.
 */

public class ClassifyRightTypePresenter implements ClassifyRightTypeContract.Presenter {
    private ClassifyRightTypeContract.View view;
    private ClassifyRightTypeContract.Model model;

    public ClassifyRightTypePresenter(ClassifyRightTypeContract.View view) {
        this.view = view;
        model = new ClassifyRightTypeModel();
    }

    @Override
    public void getRightTypeFromNet(final String code_mgroup) {
        model.getRightTypeView(code_mgroup,new ClassifyRightTypeModel.onGetRightTypeListener(){
            @Override
            public void LoadRightTypeUrl(List<ClassifyRightTypeBean> list_right,String tag_img_path) {
                if(list_right!=null){
                    view.onRigthTypeSuccess(list_right,tag_img_path);
                    Log.i("tag","下载成功");
                }else{
                    view.onRigthTypeFail("下载失败");
                    Log.i("tag","下载失败");
                }

            }
        });


    }
}
